﻿#include <iostream>
#include "mdclieapi.hpp"

int main(int argc, char* argv[])
{
	bool verbose = (argc > 1 && std::string(argv[1]) == "-v");
	mdclient client("tcp://localhost:5555", verbose);

	try
	{
		int count;
		for (count = 0; count < 10000; ++count)
		{
			zframe frame;
			frame.push_back("Hello world");
			zframe reply = client.send("echo", frame);
			if (reply.is_empty())
			{
				break;
			}

			if (count % 1000 == 0)
			{
				info("{} requests/replies processed", count);
			}
		}
		info("{} requests/replies processed", count);
	}
	catch (zmq::error_t& e)
	{
		info("error {}", e.what());
	}
	
	
	int a;
	std::cin >> a;
}
